package test.yzx.pproject.act4;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;

import test.yzx.pproject.R;


public class ViewPostTestActivity extends AppCompatActivity{

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        final View view = getLayoutInflater().inflate(R.layout.layout_activity_post_test, (ViewGroup) getWindow().getDecorView(), false);

        view.post(new Runnable() {
            public void run() {

                Toast.makeText(ViewPostTestActivity.this, ""+view.getMeasuredWidth(), Toast.LENGTH_SHORT).show();

            }
        });

    }

}
